<?php

/**
 * eMedia functions
 * 
 * @copyright (c) 2012 University of Geneva
 * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
 * @author Laurent Opprecht laurent@opprecht.info
 */
class EMedia
{

    public static function get_string($identifier, $component = 'emedia', $a = NULL)
    {
        return get_string($identifier, $component, $a);
    }

    public static function filter_url($url)
    {
        $u = trim($url);
        if (strpos($u, 'http') !== 0)
        {
            $url = trim($url, '/');
            $url = 'http://' . $url;
        }

        $result = filter_var($url, FILTER_VALIDATE_URL);
        return $result;
    }

    public static function is_url($url)
    {
        return self::filter_url($url) != false;
    }
    
}